<?php

class SettingsController extends AppController {

	var $name = 'Settings';
	var $scaffold;
	
	function isAuthorized(){
		if($this->Auth->user('csoport') == 1){		//admin jogosultságú júzerek
			return true;
		}
		if($this->request->action == 'savecache'){
			return true;
		}
		return false;		//minden más tiltva
	}
	
	function saveCache(){
		Configure::write('debug', 0);
		$data = array('Setting' => array(
													'id'				=>	'cache' . time(),
													'value'			=>	time(),
													'description'	=>	$this->request->data['cache'],
													));
		$saveCache = $this->Setting->save($data);
		$saveCache = $saveCache ? true : false;
		$this->set('saveCache', $saveCache);
	}	
}

?>